home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / STRINGS / STRCODE.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-09  |  1KB  |  33 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; string coding
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBINI, EFLIBTXT, CRT;
  10.  
  11. var StringCode : StringCodeObjectType;
  12.     MyString : string;
  13.  
  14.  
  15. begin
  16.      with StringCode do begin
  17.           { Initialize string code object with address of a text string }
  18.           Initialize (@MyString);
  19.  
  20.           MyString := '@Yellow:Green@-=> String coding technology makes text formatting ' +
  21.                       'easy.@C@ <=-';
  22.  
  23.           { Change attribute if string contains color codes }
  24.           if IsColored then TextAttr := StringCode.Attribute;
  25.  
  26.           { Write formatted string }
  27.           Write (TextFormatted(79));
  28.           { Restore previois attribute }
  29.           TextAttr := 7; WriteLn;
  30.           Intercept;
  31.      end;
  32. end.
  33.